package com.ruibang.glass.purchase.feign;

import com.ruibang.glass.common.domain.material.MaterialALLOutboundManagement;
import com.ruibang.glass.common.domain.material.MaterialAllManagementInventory;
import com.ruibang.glass.common.domain.material.MaterialManagement;
import com.ruibang.glass.purchase.domain.req.MaterialInventoryItem;
import com.teaming.cloud.framework2.common.model.ResultBody;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@FeignClient("glass-material")
@Component
public interface MaterialApi {
    /**
     * 材料入库
     *
     * @param materialAllManagementInventory
     */
    @RequestMapping(value = "/api/material/cl/management/inventory/add", method = RequestMethod.POST)
    ResultBody<String> addMaterialClLocationManagement(@RequestBody MaterialAllManagementInventory materialAllManagementInventory);

    /**
     * 办公家居入库
     *
     * @param materialAllManagementInventory
     */
    @RequestMapping(value = "/api/material/bgjj/management/inventory/add", method = RequestMethod.POST)
    ResultBody<String> addMaterialBGJJLocationManagement(@RequestBody MaterialAllManagementInventory materialAllManagementInventory);

    /**
     * 劳保用品
     *
     * @param materialAllManagementInventory
     */
    @RequestMapping(value = "/api/material/lbyp/management/inventory/add", method = RequestMethod.POST)
    ResultBody<String> addMaterialLBYPLocationManagement(@RequestBody MaterialAllManagementInventory materialAllManagementInventory);

    /**
     * 备品备件
     *
     * @param materialAllManagementInventory
     */
    @RequestMapping(value = "/api/material/bhbj/management/inventory/add", method = RequestMethod.POST)
    ResultBody<String> addMaterialBHBJLocationManagement(@RequestBody MaterialAllManagementInventory materialAllManagementInventory);

    /**
     * 原材料
     *
     * @param materialAllManagementInventory
     */
    @RequestMapping(value = "/api/material/ycl/management/inventory/add", method = RequestMethod.POST)
    ResultBody<String> addMaterialYCLLocationManagement(@RequestBody MaterialAllManagementInventory materialAllManagementInventory);

    /**
     * 电子设备
     *
     * @param materialAllManagementInventory
     */
    @RequestMapping(value = "/api/material/dzsb/management/inventory/add", method = RequestMethod.POST)
    ResultBody<String> addMaterialDZSBLocationManagement(@RequestBody MaterialAllManagementInventory materialAllManagementInventory);

    /**
     * 服务库
     *
     * @param materialAllManagementInventory
     */
    @RequestMapping(value = "/api/material/fwk/management/inventory/add", method = RequestMethod.POST)
    ResultBody<String> addMaterialFWKLocationManagement(@RequestBody MaterialAllManagementInventory materialAllManagementInventory);

    /**
     * 工具
     *
     * @param materialAllManagementInventory
     */
    @RequestMapping(value = "/api/material/gj/management/inventory/add", method = RequestMethod.POST)
    ResultBody<String> addMaterialGJLocationManagement(@RequestBody MaterialAllManagementInventory materialAllManagementInventory);

    /**
     * 贵金属
     *
     * @param materialAllManagementInventory
     */
    @RequestMapping(value = "/api/material/gjs/management/inventory/add", method = RequestMethod.POST)
    ResultBody<String> addMaterialGJSLocationManagement(@RequestBody MaterialAllManagementInventory materialAllManagementInventory);

    /**
     * 化学品
     *
     * @param materialAllManagementInventory
     */
    @RequestMapping(value = "/api/material/hxp/management/inventory/add", method = RequestMethod.POST)
    ResultBody<String> addMaterialHXPLocationManagement(@RequestBody MaterialAllManagementInventory materialAllManagementInventory);

    /**
     * 能源动力
     *
     * @param materialAllManagementInventory
     */
    @RequestMapping(value = "/api/material/nydl/management/inventory/add", method = RequestMethod.POST)
    ResultBody<String> addMaterialNYDLLocationManagement(@RequestBody MaterialAllManagementInventory materialAllManagementInventory);

    /**
     * 仪表仪器
     *
     * @param materialAllManagementInventory
     */
    @RequestMapping(value = "/api/material/ybyq/management/inventory/add", method = RequestMethod.POST)
    ResultBody<String> addMaterialYBYQLocationManagement(@RequestBody MaterialAllManagementInventory materialAllManagementInventory);

    /**
     * 杂品库
     *
     * @param materialAllManagementInventory
     */
    @RequestMapping(value = "/api/material/zpk/management/inventory/add", method = RequestMethod.POST)
    ResultBody<String> addMaterialZPKLocationManagement(@RequestBody MaterialAllManagementInventory materialAllManagementInventory);


    /**
     * 查询物料详情
     * @param id
     * @return
     */
    @RequestMapping(value = "/api/glass/material/management/getOne/{id}", method = RequestMethod.GET)
    ResultBody<MaterialManagement> getMaterialBYId(@PathVariable("id") String id);


    @RequestMapping(value = "/api/glass/material/management/getWarehouseByIds", method = RequestMethod.POST)
    ResultBody<List<MaterialManagement>> getWarehouseByIds(@RequestBody List<String> itemIds);

    @RequestMapping(value = "/api/glass/material/management/getMaterialManagerByIds", method = RequestMethod.POST)
    ResultBody<List<MaterialManagement>> getMaterialManagerByIds(@RequestBody List<String> ids);

    @RequestMapping(value = "/api/material/inventory/item/batchAdd", method = RequestMethod.POST)
    ResultBody batchAdd(@RequestBody List<MaterialInventoryItem> inventoryItems);

    @RequestMapping(value = "/api/material/inventory/item/getYCLIdList", method = RequestMethod.GET)
    ResultBody<List<String>> getYCLIdList();


    @RequestMapping(value = "/api/material/inventory/item/updateQualityByNumber", method = RequestMethod.POST)
    ResultBody updateQualityByNumber(@RequestBody List<MaterialInventoryItem> inventoryItems);


    /**
     *
     * 出库申请其他模块
     */
    @RequestMapping(value = "/api/material/cksq/out/bound/manage/addByPurchaseReturn", method = RequestMethod.POST)
    ResultBody outAllMaterial(@RequestBody MaterialALLOutboundManagement materialALLOutboundManagement);

    /**
     * 出库申请原材料
     * @param materialALLOutboundManagement
     * @return
     */
    @RequestMapping(value = "/api/material/cksq/out/bound/manage/addByPurchaseYclList", method = RequestMethod.POST)
    ResultBody outYClMaterial(@RequestBody MaterialALLOutboundManagement materialALLOutboundManagement);

}
